﻿using System;
using Telerik.Web.UI;

public partial class ltMan_votes_voteList : AdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlPager pager = new SqlPager("lt_class", "id", "*");
        if (!string.IsNullOrEmpty(sName.Text))
            pager.Where = " title like '%" + sName.Text.Replace("'", "''") + "%'";
        pager.OrderBy = "id desc";
        RadGridBinder.Create(RadGrid1, pager);
    }
    protected void RadGrid1_DeleteCommand(object sender, GridCommandEventArgs e)
    {
        ltModel.BLL.Class kls = new ltModel.BLL.Class();
        int id = int.Parse(GridCommander.ExtractValue(e, "id"));
        OperateLog.AddFailedLog(CurrentUser.user_id, Request.UserHostAddress, "投票管理-删除>" + kls.GetModel(id).title);
        kls.Delete(id);
        new ltModel.BLL.vote().DeleteCid(id);
    }
    protected void b1_Click(object sender, EventArgs e)
    {
        RadGrid1.Rebind();
    }
}